import os
import re
import sys
import time

def is_valid_string(a):
    # 正则表达式匹配只包含数字和逗号的字符串
    pattern = r'^[0-9,]+$'
    return bool(re.match(pattern, a))
def clear_screen():
    os.system('cls' if os.name == 'nt' else 'clear')

def title():
    print('\033[1;36m====================================================')
    print(' ______  ______  ______ ______            Arknights                                 ')
    print('/\  ___\/\  == \/\  ___\/\  ___\                                                                     ')
    print('\ \  __\\ \  __<\ \  __\\ \  __\                                                                       ')
    print(' \ \_\   \ \_\ \_\ \_____\ \_____\                                                                  ')
    print('  \/_/    \/_/ /_/\/_____/\/_____/__  __  ______                                           ')
    print('           /\ "-./  \/\ \/\ \/\  ___\/\ \/\  ___\                                                        ')
    print('           \ \ \-./\ \ \ \_\ \ \___  \ \ \ \ \____                                                      ')
    print('Author:Amiya\ \_\ \ \_\ \_____\/\_____\ \_\ \_____\                                            ')
    print('Vision:4.0   \/_/  \/_/\/_____/\/_____/\/_/\/_____/                                            ')
    print('====================================================\033[0m')
#\033[1;36m  蓝色 \033[0m
def dir(file):
    for i in range(0,len(file)):
        print(f'[{i+1}]{file[i]}')
def p():
    executable = sys.executable
    if "python3" in executable:
        p = str('python3')
    elif "python" in executable:
        p = str('python')
    else:
        exit()
    return p
def input_g(data, color=32):
    if isinstance(color ,int):
        color = str(color)
    return input(f'\033[1;{color}m{data}\033[0m')
def input_r(data, color=31):
    if isinstance(color ,int):
        color = str(color)
    return input(f'\033[1;{color}m{data}\033[0m')
def print_g(data, color=32):
    if isinstance(color ,int):
        color = str(color)
    return print(f'\033[1;{color}m{data}\033[0m')
def print_r(data, color=31):
    if isinstance(color ,int):
        color = str(color)
    return print(f'\033[1;{color}m{data}\033[0m')
def print_db(data, color=35):
    if isinstance(color ,int):
        color = str(color)
    return print(f'\033[1;{color}m{data}\033[0m')
def print_b(data, color=34):
    if isinstance(color ,int):
        color = str(color)
    return print(f'\033[1;{color}m{data}\033[0m')

